home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
awe2-0_1.lha
/
awe2-0.1
/
Src
/
RCS
/
SharedMemory-umax.cc,v
< prev
next >
Wrap
Text File
|
1989-05-09
|
2KB
|
122 lines
head 3.2;
branch ;
access ;
symbols ;
locks grunwald:3.2; strict;
comment @@;
3.2
date 89.02.20.15.37.22; author grunwald; state Exp;
branches ;
next 3.1;
3.1
date 88.12.20.13.49.14; author grunwald; state Exp;
branches ;
next 1.2;
1.2
date 88.10.30.13.04.37; author grunwald; state Exp;
branches ;
next 1.1;
1.1
date 88.09.28.22.13.35; author grunwald; state Exp;
branches ;
next ;
desc
@@
3.2
log
@Start using Gnu library heaps for schedulers
@
text
@// This may look like C code, but it is really -*- C++ -*-
//
// Copyright (C) 1988 University of Illinois, Urbana, Illinois
//
// written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
//
#include "SharedMemory.h"
#include "assert.h"
#include "Pragma.h"
PRAGMA_LINKAGE_C
extern char *sbrk(unsigned);
extern void perror(char *);
extern void exit(int x = 0);
extern char * share( unsigned, unsigned );
PRAGMA_LINKAGE
//
// Not really a part of CpuMultiplexor, but used by it & hidden here.
//
void
SharedMemoryInit( unsigned extra )
{
//
// Bump the break if necessary.
//
assert(extra >= 0);
char * newBreak = sbrk( extra );
if ( newBreak == (char *) -1 ) {
perror( "Share: sbrk" );
exit( 1 );
}
newBreak = sbrk( 0 );
//
// Share .data, .bss, and the extra.
//
extern int environ;
unsigned shareStart = (unsigned) &environ;
unsigned shareSize = (unsigned) newBreak - shareStart;
char * sharePointer = share( shareStart, shareSize );
if ( sharePointer == 0 ) {
perror( "Share: share" );
exit( 1 );
}
extern void disableFurtherBreaks();
disableFurtherBreaks();
}
@
3.1
log
@Steay version
@
text
@@
1.2
log
@*** empty log message ***
@
text
@d9 1
d11 1
d15 2
a38 1
extern char * share( unsigned, unsigned );
@
1.1
log
@Initial revision
@
text
@d1 6
d15 1
a15 1
// Not really a part of HardwareCpu, but used by it & hidden here.
@